/*
 * Copyright (c) 2015. For Intelligent Group.
 */

package com.intelligent.ispc.foundation.poi;

import com.google.common.collect.Lists;
import com.intelligent.ispc.foundation.pdf.ExPdfPage;
import com.intelligent.ispc.foundation.pdf.SamplePdfBuilder;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfPTable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

/**
 * Created by cherry on 2016/8/12.
 */
public class testExportPdf {

    private static Logger logger = LoggerFactory.getLogger(testExportPdf.class);

    public static void main(String [] args) {
        SamplePdfBuilder samplePdfBuilder = new SamplePdfBuilder();
        String filePath = "J:/a.pdf";
        List<ExPdfPage> exPdfPages = Lists.newArrayList();
        for (int i=0; i<2; i++) {
            ExPdfPage exPdfPage = new ExPdfPage();
            List<PdfPTable> tables = Lists.newArrayList();
            String data = "";
            if (i==0) {
                data = "aaaaaaaaaaa";
            }
            if (i == 1) {
                data = "b";
            }
            for (int j=0; j<1; j++) {
                PdfPTable table = new PdfPTable(6);
                table.addCell(data);
                table.addCell(data);
                table.addCell(data);
                table.addCell(data);
                table.addCell(data);
                table.addCell(data);
                tables.add(table);
            }
            exPdfPage.setPageTitle(new Paragraph("ppggg" + i));
            exPdfPage.setTables(tables);
            exPdfPages.add(exPdfPage);
        }
//        samplePdfBuilder.drawPdf(filePath, exPdfPages);
    }

}
